home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / C for beginners.adf / source / countdown.c < prev    next >
C/C++ Source or Header  |  1978-01-17  |  563b  |  33 lines

  1. /* countdown.c 16.4.1 */
  2. #include <stdio.h>
  3.  
  4. void main()
  5. {
  6.   printf("Time comparison with and without register\n");
  7.   printf("RETURN for start\n");
  8.   getchar();
  9.   printf("%cStart without_register", 7);
  10.   without_register();
  11.   printf("%c\nStop!\nregister routine\n",7);
  12.   printf("RETURN for start\n");
  13.   getchar();
  14.   printf("%cStart with_register", 7);
  15.   with_register();
  16.   printf("%c\nStop!\n\n", 7);
  17. }  
  18.  
  19. with_register()
  20. {
  21.   register long i =5000000;/*Count from 5,000,000 to 0 */
  22.   while(i--)
  23.   ;
  24. }
  25.  
  26. without_register()
  27. {
  28.   long i = 5000000;
  29.   while(i--)
  30.   ;
  31. }
  32.  
  33.